<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="https://cdn.bootcdn.net/ajax/libs/axios/0.19.2/axios.js"></script>
</head>

<body>

    <script>
        // axios.get('http://www.liulongbin.top:3006/api/getbooks')
        //   .then(function (res) {
        //     const { data } = res
        //     console.log(data)
        //   })

        axios.post('http://www.liulongbin.top:3006/api/addbook', {
                bookname: '毛泽东选集',
                author: '毛爷爷',
                publisher: '黑马程序员'
            }).then(function(res) {
                console.log(res)
                const {
                    data
                } = res
                console.log(data)
            })
            // axios.post('http://www.liulongbin.top:3006/api/addbook', {
            //     bookname: '别看了你是傻逼',
            //     author: '祁腾飞',
            //     publisher: '5组'
            // }).then(res => {
            //     console.log(res.data);
            //     const {
            //         data
            //     } = res;
            //     console.log(data)
            // })
    </script>
</body>

</html>